#include "stdafx.h"
#include "..\headers\Convert.h"

namespace ne{

const std::string Convert::BoolToString(bool p_value) {
	if (p_value){
		return "true";
	}
	return "false";
}



bool Convert::StringToBool(const std::string& p_line) {
	std::string temp = p_line;
	for (unsigned int i = 0; i < temp.length(); i++) {
		temp[i] = tolower(temp[i]);	// convert all characters to lower case, will make checking the string easier.
	}
	return (temp == "true") ? true : false;
}



btQuaternion Convert::ToBullet(const Ogre::Quaternion& q){
	return btQuaternion(q.x,q.y,q.z,q.w);
}



btVector3 Convert::ToBullet(const Ogre::Vector3& v){
	return btVector3(v.x,v.y,v.z);
}



Ogre::Quaternion Convert::ToOgre(const btQuaternion& q){
	return Ogre::Quaternion(q.w(),q.x(),q.y(),q.z());
}



Ogre::Vector3 Convert::ToOgre(const btVector3& v){
	return Ogre::Vector3(v.x(),v.y(),v.z());
}

}